#pragma once

#include "Widget/QRSWidgetBase.h"
#include "ui_QRWSketchCreateWidget.h"
#include "Render/QIVtkSelectionPipeline.h"

QT_BEGIN_NAMESPACE
namespace Ui { class QRWSketchCreateWidgetClass; };
QT_END_NAMESPACE

class MainWindow;
class ShapeOperation;

class QRWSketchCreateWidget : public QRSWidgetBase
{
	Q_OBJECT

public:
	QRWSketchCreateWidget(MainWindow* inMainWindow, ShapeOperation* inOperation = nullptr, QWidget* parent = nullptr);
	~QRWSketchCreateWidget();

protected:

	void OnSelectedSubShapes(QIVtkSelectionPipeline* actor);
	virtual void closeEvent(QCloseEvent* event) override;
	bool eventFilter(QObject* obj, QEvent* event) override;
	void onConfirm();
	void OnTargetComboIndexChange(int index);
	void onLeftButtonDown();
	void OnPickPosition(const gp_Pnt& position);

private:
	Ui::QRWSketchCreateWidgetClass *ui;

	RWTripleFloatInput* m_right;
	RWTripleFloatInput* m_center;
	RWTripleFloatInput* m_normal;

	int focusIndex = -1;
};
